]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
telepathyClient: Check for a no-op before pushing an alias change message
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 3 Oct 2011 18:48:49 +0000 (14:48 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 5 Oct 2011 19:34:40 +0000 (15:34 -0400)
tp-glib can sometimes emit a notify::alias signal when the alias doesn't
actually change. Bail out early instead of pushing an alias change message.

https://bugzilla.gnome.org/show_bug.cgi?id=660774

js/ui/telepathyClient.js

index 0ea3a7e9eb19329770656682fb60c8ca6ce416ac..a0a58236ff3083216fd491312e3033bd74979f92 100644 (file)
@@ -539,9 +539,13 @@ ChatSource.prototype = {
 
     _updateAlias: function() {
         let oldAlias = this.title;
-        this.setTitle(this._contact.get_alias());
-        this._notification.appendAliasChange(oldAlias, this.title);
-        this.pushNotification(this._notification);
+        let newAlias = this._contact.get_alias();
+
+        if (oldAlias == newAlias)
+            return;
+
+        this.setTitle(newAlias);
+        this._notification.appendAliasChange(oldAlias, newAlias);
     },
 
     createNotificationIcon: function() {